﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WPFCouse
{
    /// <summary>
    /// RadioButtonWindow.xaml 的交互逻辑
    /// </summary>
    public partial class RadioButtonWindow : Window
    {
        public RadioButtonWindow()
        {
            InitializeComponent();
        }
        string roleName = "";
        int checkId = 0;
        private void rbtn_Checked(object sender, RoutedEventArgs e)
        {
            RadioButton rb = sender as RadioButton;
            //MessageBox.Show($"{rb.Content.ToString()}已选中");
            roleName = rb.Content.ToString();
            checkId = Convert.ToInt32(rb.Tag);
        }

        private void rbtn_Unchecked(object sender, RoutedEventArgs e)
        {
            RadioButton rb = sender as RadioButton;
            MessageBox.Show($"{rb.Content.ToString()}未选中");
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string roles = roleName;
            int roleId = checkId;
            MessageBox.Show(roleId.ToString());
        }
    }
}
